home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_eweb_m.cog < prev    next >
Text File  |  1998-02-25  |  1KB  |  57 lines

  1. # Jedi Knight Missions Cog Script
  2. #
  3. # POW_EWEB_M.COG
  4. #
  5. # POWERUP Script - EWEB Gun
  6. #
  7. # [RF]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. int         bin=10                           local
  17. int         mappedBin                        local
  18. int         ammobin=92                       local
  19. flex        amount                           local
  20.  
  21. message     activated
  22.  
  23. end
  24.  
  25. # ========================================================================================
  26.  
  27. code
  28.  
  29. activated:
  30.    player = GetSourceRef();
  31.    powerup = GetSenderRef();
  32.  
  33.     if (!GetInv(player, ammobin))
  34.     {
  35.         jkPrintUNIString(player, 380);    // You have no ammo to use with the EWEB!
  36.     }
  37.     else
  38.     {
  39.         if (!IsThingCrouching(player))        // Do not allow selection while crouching.
  40.         {
  41.             jkPrintUNIString(player, 382);    // The Blaster Cannon!
  42.     
  43.             mappedBin = GetWeaponBin(bin);
  44.     
  45.             SetInvActivated(player, mappedBin, 1);
  46.     
  47.                 // Make the inventory equal to the powerup
  48.                 // reference.  Got a problem with that?  Huh?
  49.             SetInv(player, mappedBin, powerup);
  50.     
  51.             SelectWeapon(player, mappedBin);
  52.         }
  53.     }
  54.    Return;
  55.  
  56. end
  57.